package com.hehe.Service;

import com.hehe.POJO.T_user;
import com.hehe.Repository.T_User_Repository;
import jakarta.annotation.Resource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

@Service
public class T_User_Service {

    @Resource
    private T_User_Repository userRepository;

    public Page<T_user> getUsersByStatus(Byte status, int page, int size) {
        Pageable pageable = PageRequest.of(page, size, Sort.by("createtime").descending());
        return userRepository.findByStatuss(status, pageable);
    }

}
